var fs = require('fs');
var path = require('path');

function formatDate() {
	var now = new Date();
	return [now.getFullYear(), now.getMonth() + 1, now.getDate()].join('-');
}

exports.formatDate = formatDate;

function trim(str) {
	
	return typeof str == 'string' ? str.trim() : (str == null ? str : str + '');
}

exports.trim = trim;

function mkdir(path) {
	if (!fs.existsSync(path)) {
		fs.mkdirSync(path);
	}
	return path;
}

exports.mkdir = mkdir;

function drain(res) {
	res.on('data', noop);
}

exports.drain = drain;

function noop() {}

exports.noop = noop;